package 晚自习练习;

public class 求和 {
    public static void main(String[] args) {
        int[] arr = {120, 130, 110, 125, 128, 164};

        double sum = 0;

        double arg;

        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }

        arg = sum / arr.length;

        System.out.println("这个数组的和是：" + sum);
        System.out.println("这个数组的平均值是：" + arg);
    }
}
